Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the constraint that stim.Tableau.from_state_vector inputs must be normalized #840

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

drqec
Copy link
Contributor

@drqec drqec commented Sep 27, 2024

Just taking a stab at fixing #638. Note, I don't fully understand how Tableau should work but I wrote the tests based on the examples, so I think this should be correct.

  • Adds normalization code by scaling each amplitude by the square root of the inverse of the state vector norm
  • Adds tests to match the examples from from_state_vector including an unnormalized version

Copy link
Collaborator

@Strilanc Strilanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is basically the functionality that's desired, but a few more tests and pushing it down into the C++ are needed.

src/stim/stabilizers/tableau.pybind.cc Outdated Show resolved Hide resolved
src/stim/stabilizers/tableau.pybind.cc Outdated Show resolved Hide resolved
src/stim/stabilizers/tableau_pybind_test.py Outdated Show resolved Hide resolved
@drqec drqec force-pushed the normalize-state-vectors branch 2 times, most recently from d4468ba to 75d9bde Compare October 8, 2024 22:27
@drqec drqec force-pushed the normalize-state-vectors branch from 75d9bde to c9607db Compare October 8, 2024 22:30
src/stim/stabilizers/tableau_pybind_test.py Outdated Show resolved Hide resolved
src/stim/util_top/circuit_vs_amplitudes.cc Show resolved Hide resolved
@drqec drqec requested a review from Strilanc October 11, 2024 21:24
@Strilanc Strilanc merged commit 34b4168 into quantumlib:main Oct 11, 2024
57 checks passed
@Strilanc
Copy link
Collaborator

Thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants